//
//  MacInvoker.swift
//  ArchitectGenerics
//
//  Created by 姚胜龙 on 2017/6/6.
//  Copyright © 2017年 姚胜龙. All rights reserved.
//

import UIKit

//请求者：Mac电脑的请求者

class MacInvoker: NSObject {

    //持有Mac电脑的命令对象引用
    private var startupCommand:MacStartupCommand?
    private var shutdownCommand:MacShutdownCommand?

    init(startupCommand:MacStartupCommand,shutdownCommand:MacShutdownCommand)
    {
        self.startupCommand = startupCommand
        self.shutdownCommand = shutdownCommand
    }

    func startup() {
        self.startupCommand?.execute()
    }

    func shutdown() {
        self.shutdownCommand?.execute()
    }
}
